//
//  VoiceBroadcastViewController.m
//  CoachsBook
//
//  Created by MaBookPro on 2022/8/23.
//

#import "VoiceBroadcastViewController.h"
#import "SubjectTwoManualViewController.h"
#import "SubjectThreeLightVoiceViewController.h"
#import "VoiceBroadcastSettingsViewController.h"
#import "MyVoiceSystemViewController.h"

@interface VoiceBroadcastViewController ()

@end

@implementation VoiceBroadcastViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.view.backgroundColor = [UIColor whiteColor];
    //隐藏头部view
    self.navigationController.navigationBar.hidden = YES;
    NavigationHeadView *navgationheadv = [[NavigationHeadView alloc]initWithFrame:CGRectMake(0, 0, APPwidth, SafeAreaTopHight)];
    navgationheadv.titlelabel.text = @"语音播报";
    navgationheadv.titlelabel.textColor = [UIColor blackColor];
    navgationheadv.backbtn.hidden = NO;
    navgationheadv.rightbtn.hidden = NO;
    [navgationheadv.rightbtn setTitle:@"设置" forState:0];
    [navgationheadv.rightbtn addTarget:self action:@selector(setBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [navgationheadv.rightbtn setTitleColor:rgba(22, 120, 255, 1) forState:0];
    [navgationheadv.backbtn addTarget:self action:@selector(returnback) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:navgationheadv];

    [self creatListUI];

}
-(void)creatListUI{

    UIView *backWhiteV = [[UIView alloc]initWithFrame:CGRectMake(0, SafeAreaTopHight, APPwidth, APPheight)];
    backWhiteV.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:backWhiteV];
    
    UIButton *addressTypeBtn = [[UIButton alloc]initWithFrame:CGRectMake(15,0, APPwidth-30, 45)];
    [addressTypeBtn setTitle:@"长沙市" forState:0];
    [addressTypeBtn setBackgroundColor:rgba(236, 244, 255, 1)];
    [addressTypeBtn setImage:[UIImage imageNamed:@"dizhihuhuan"] forState:0];
    addressTypeBtn.contentHorizontalAlignment = 1;
    [addressTypeBtn setTitleColor:rgba(51, 51, 51, 1) forState:0];
    addressTypeBtn.titleLabel.font = [UIFont boldSystemFontOfSize:16];
    addressTypeBtn.layer.cornerRadius = 8;
    addressTypeBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 20, 0, 0);
    [addressTypeBtn.imageView setContentMode:UIViewContentModeScaleAspectFit];
    addressTypeBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 40, 0, 0);
    [backWhiteV addSubview:addressTypeBtn];
    
//    通用类型
    UIButton *typeBtn = [[UIButton alloc]initWithFrame:CGRectMake(addressTypeBtn.width/2+50, 10, addressTypeBtn.width/2-60, 25)];
    [typeBtn setTitle:@"全国通用-基础版" forState:0];
    [typeBtn setImage:[UIImage imageNamed:@"arrowl"] forState:0];
    typeBtn.contentHorizontalAlignment = 1;
    [typeBtn setTitleColor:rgba(51, 51, 51, 1) forState:0];
    typeBtn.titleLabel.font = [UIFont systemFontOfSize:13];
    typeBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 120, 0, 0);
    [addressTypeBtn addTarget:self action:@selector(addressChoiceClick) forControlEvents:UIControlEventTouchUpInside];
    [addressTypeBtn addSubview:typeBtn];
    
//    科目二
    UIView *line = [[UIView alloc]initWithFrame:CGRectMake(15, addressTypeBtn.height+addressTypeBtn.y+ 15, 3, 15)];
    line.backgroundColor = rgba(22, 120, 255, 1);
    line.layer.cornerRadius = 2;
    [backWhiteV addSubview:line];
    UILabel *class2 = [[UILabel alloc]initWithFrame:CGRectMake(line.frame.size.width+line.frame.origin.x+5, addressTypeBtn.frame.size.height+addressTypeBtn.frame.origin.y+15, 70, 15)];
    class2.text = @"科目二";
    class2.textColor = [UIColor blackColor];
    class2.textAlignment = 0;
    class2.font = [UIFont systemFontOfSize:16 weight:bold];
    [backWhiteV addSubview:class2];

    UIButton *monikaoshiBtn = [[UIButton alloc]initWithFrame:CGRectMake(APPwidth/4-200/2, class2.height+class2.y+15, 200, 85)];
    [monikaoshiBtn setTitleColor:rgba(51, 51, 51, 1) forState:0];
    [monikaoshiBtn setImage:[UIImage imageNamed:@"monikaoshi"] forState:0];
    [backWhiteV addSubview:monikaoshiBtn];
    
    UIButton *shoudongbobaoBtn = [[UIButton alloc]initWithFrame:CGRectMake(APPwidth/4+220/2, class2.height+class2.y+15, 200, 85)];
    [shoudongbobaoBtn setTitleColor:rgba(51, 51, 51, 1) forState:0];
    [shoudongbobaoBtn setImage:[UIImage imageNamed:@"shoudongbobao"] forState:0];
    [shoudongbobaoBtn addTarget:self action:@selector(shoudongbobaoBtnClick2) forControlEvents:UIControlEventTouchUpInside];
    [backWhiteV addSubview:shoudongbobaoBtn];
    
    
    UIView *middleLine = [[UIView alloc]initWithFrame:CGRectMake(0, shoudongbobaoBtn.height+shoudongbobaoBtn.y+25, APPwidth, 10)];
    middleLine.backgroundColor = rgba(245, 245, 250, 1);
    [backWhiteV addSubview:middleLine];

    //    科目三
        UIView *line3 = [[UIView alloc]initWithFrame:CGRectMake(15, middleLine.height+middleLine.y+15, 3, 15)];
        line3.backgroundColor = rgba(22, 120, 255, 1);
        line3.layer.cornerRadius = 2;
        [backWhiteV addSubview:line3];
        UILabel *class3 = [[UILabel alloc]initWithFrame:CGRectMake(line3.frame.size.width+line3.frame.origin.x+5, middleLine.frame.size.height+middleLine.frame.origin.y+15, 70, 15)];
    class3.text = @"科目三";
    class3.textColor = [UIColor blackColor];
    class3.textAlignment = 0;
    class3.font = [UIFont systemFontOfSize:16 weight:bold];
        [backWhiteV addSubview:class3];

        UIButton *monikaoshiBtn3 = [[UIButton alloc]initWithFrame:CGRectMake(APPwidth/4-200/2, class3.height+class3.y+15, 200, 85)];
        [monikaoshiBtn3 setTitleColor:rgba(51, 51, 51, 1) forState:0];
        [monikaoshiBtn3 setImage:[UIImage imageNamed:@"monikaoshi"] forState:0];
        [backWhiteV addSubview:monikaoshiBtn3];
        
        UIButton *shoudongbobaoBtn3 = [[UIButton alloc]initWithFrame:CGRectMake(APPwidth/4+220/2, class3.height+class3.y+15, 200, 85)];
        [shoudongbobaoBtn3 setTitleColor:rgba(51, 51, 51, 1) forState:0];
        [shoudongbobaoBtn3 setImage:[UIImage imageNamed:@"shoudongbobao"] forState:0];
        [backWhiteV addSubview:shoudongbobaoBtn3];
        
    //灯光语音
    UIButton *lightVoiceBtn = [[UIButton alloc]initWithFrame:CGRectMake(APPwidth/2-(APPwidth-60)/2, monikaoshiBtn3.height+monikaoshiBtn3.y+20, APPwidth-60, 85)];
    [lightVoiceBtn setBackgroundImage:[UIImage imageNamed:@"dengguangyuyin"] forState:0];
    [lightVoiceBtn.imageView setContentMode:UIViewContentModeScaleToFill];
    [lightVoiceBtn addTarget:self action:@selector(lightVoiceBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [backWhiteV addSubview:lightVoiceBtn];
    
    
    
    
    
}
#pragma mark - 我的语音设置
-(void)addressChoiceClick{
    MyVoiceSystemViewController *vc = [[MyVoiceSystemViewController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
}
-(void)setBtnClick{
    VoiceBroadcastSettingsViewController *vc = [[VoiceBroadcastSettingsViewController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
}

-(void)lightVoiceBtnClick{
    SubjectThreeLightVoiceViewController *vc = [[SubjectThreeLightVoiceViewController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
}

-(void)shoudongbobaoBtnClick2{
    SubjectTwoManualViewController *vc = [[SubjectTwoManualViewController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
}

-(void)returnback{
    [self.navigationController popViewControllerAnimated:YES];
}
#pragma mark -视图即将出现
-(void)viewWillAppear:(BOOL)animated{
        
    ((TabbarController *)self.tabBarController).tabBarView.hidden = YES;
    
}


@end
